package com.secsbrain.deploy.utils.command;

import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.ExecuteException;

/**
 * 执行策略适配器
 * Created by yangyang.zhang on 2017/8/21.
 */
public class ExecuteStrategyAdapter extends DefaultExecuteResultHandler implements ExecuteStrategy {
    @Override
    public void processLine(String line) {

    }

    @Override
    public void handleException(Exception e) {

    }

    @Override
    public void handleResult(Object result) {

    }

    @Override
    public void onProcessComplete(int exitValue) {
        super.onProcessComplete(exitValue);
        handleResult(exitValue);
    }

    @Override
    public void onProcessFailed(ExecuteException e) {
        super.onProcessFailed(e);
        handleException(e);
    }

}
